package com.ydl.shopping.security.context;

import com.ydl.shopping.core.entity.LoginUser;

/**
 * 登录用户信息
 * 
 * @author 林武泰
 */
public class LoginUserContextHolder
{
    private static final ThreadLocal<LoginUser> contextHolder = new ThreadLocal<>();

    public static LoginUser getContext()
    {
        return contextHolder.get();
    }

    public static void setContext(LoginUser context)
    {
        contextHolder.set(context);
    }

    public static void clearContext()
    {
        contextHolder.remove();
    }
}
